#ifndef NEOPROGRESSBARPRIVATE_H
#define NEOPROGRESSBARPRIVATE_H

#include "def.h"
#include <QPainter>

class QPropertyAnimation;
class NeoProgressBar;
class NeoProgressBarPrivate : public QObject
{
    Q_OBJECT
    NEO_PRIVATE_CREATE(NeoProgressBar)
    NEO_PROPERTY_CREATE(int, Position)
    NEO_PRIVATE_PROPERTY_CREATE_H(int, Value)
    NEO_PRIVATE_PROPERTY_CREATE_H(int, MinimumValue)
    NEO_PRIVATE_PROPERTY_CREATE_H(int, MaximumValue)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, BackgroundColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, ProgressColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QPixmap, ProgressPixmap)
    NEO_PRIVATE_PROPERTY_CREATE_H(NeoProgressBarType::TextPosition, TextPosition)
public:
    NeoProgressBarPrivate(QObject *parent = nullptr);
    ~NeoProgressBarPrivate();

    void startPositionAnimation(int position);
    void updateWidgetGeometry(QSize size);

    void drawBackground(QPainter *painter);
    void drawProgress(QPainter *painter);
    void drawText(QPainter *painter);

private:
    int pBorderRadius;
    double pPixelRatio;
    QRect pFrameRect;
    QRect pTextRect;
    QPropertyAnimation *pPositionAnimation;
};

#endif